<template>
    <div id="dashboard">
        <!--        懒加载图片信息-->
        <van-swipe :autoplay="3000">
            <van-swipe-item v-for="(image, index) in images" :key="index">
                <img v-lazy="image"/>
            </van-swipe-item>
        </van-swipe>
        <!--列表-->
        <div class="gzlist">
            <van-cell-group inset>
                <van-cell title="人员信息" />
                <van-cell :title="userInfo.uname" value="3600.00" label="2021年1月工资" />
            </van-cell-group>
        </div>

        <div class="tasklist">
            <ul>
                <li>今日事：做咩</li>
            </ul>
        </div>
    </div>
</template>
<style lang="scss" scoped>
    #dashboard{background-color: #e9eaed;}
    .gzlist{margin: 20px auto;width: 98%;border-radius: 12px;}

    .van-swipe {
        height: 180pt;
    }

    .van-swipe img {
        width: 100%;
        height: 180pt
    }
</style>
<script>
    import $store from "@/store/index";
    import {Lazyload} from 'vant';

    Vue.use(Lazyload);

    export default {
        name: "DashBoard",
        data() {
            return {
                images: [
                    'https://img01.yzcdn.cn/vant/apple-1.jpg',
                    'https://img01.yzcdn.cn/vant/apple-2.jpg',
                ],
            };
        },
        computed: {
            userInfo() {
                return $store.getters["user/info"] || {};
            },
        },
    };

</script>
